home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / cfengine-1.5.3 / src / cfkey.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-04-20  |  1.9 KB  |  63 lines

  1.  
  2. /* 
  3.  
  4.         Copyright (C) 1999
  5.         Free Software Foundation, Inc.
  6.  
  7.    This file is part of GNU cfengine - written and maintained 
  8.    by Mark Burgess, Dept of Computing and Engineering, Oslo College,
  9.    Dept. of Theoretical physics, University of Oslo
  10.  
  11.    This program is free software; you can redistribute it and/or modify it
  12.    under the terms of the GNU General Public License as published by the
  13.    Free Software Foundation; either version 2, or (at your option) any
  14.    later version.
  15.  
  16.    This program is distributed in the hope that it will be useful,
  17.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.    GNU General Public License for more details.
  20.  
  21.   You should have received a copy of the GNU General Public License
  22.   along with this program; if not, write to the Free Software
  23.   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
  24.  
  25. */
  26.  
  27.  
  28. /*****************************************************************************/
  29. /*                                                                           */
  30. /* File: cfkey.c                                                             */
  31. /*                                                                           */
  32. /*****************************************************************************/
  33.  
  34. #include "cf.defs.h"
  35. #include "cf.extern.h"
  36.  
  37. char CFLOCK[1];
  38.  
  39. main()
  40.  
  41. { char digest[16];
  42.   char seed[8],key[8];
  43.  
  44. #ifdef HAVE_LIBCRYPTO
  45.  DESMD5Random(digest);
  46.  bcopy(digest,seed,8);
  47.  des_random_seed(seed);
  48.  des_random_key(key);
  49.  printf("%8.8s",key);
  50.  des_random_key(key);
  51.  printf("%8.8s",key);
  52.  des_random_key(key);
  53.  printf("%8.8s",key);
  54. #else
  55.  printf("You do not have SSLeay installed in /usr/local/ssl\n");
  56. #endif
  57. }
  58.  
  59. /*****/
  60.  
  61. AddMultipleClasses(){}
  62. ReleaseCurrentLock(){}
  63.